package com.alibaba.algo.domain.user;

import com.alibaba.algo.cooperation.feign.vo.req.FeignBasePageReqVO;
import com.alibaba.algo.cooperation.feign.vo.req.SelectEmployeeListQeqVO;
import com.alibaba.algo.cooperation.feign.vo.req.SelectUserLabelReqVO;
import com.alibaba.algo.cooperation.feign.vo.res.OrgLabelUserInfoResVO;
import com.alibaba.algo.cooperation.feign.vo.res.UserInfoResVO;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.OrgLabelPageVO;
import com.alibaba.algo.core.base.BaseDomain;
import com.alibaba.algo.dao.user.SysLabelMapper;
import com.alibaba.algo.entity.user.SysLabel;
import com.alibaba.algo.entity.user.SysOrgLabelDetail;
import com.alibaba.algo.entity.user.SysOrgLabelList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 岗位标签
 *
 * @author Songtinghua
 * @create 2021-10-29 12:41
 **/
@Component
public class SysLabelDomain extends BaseDomain<SysLabel> {

    @Autowired
    SysLabelMapper sysLabelMapper;

    public SysLabel selectByLabelCode(String labelCode) {
        return sysLabelMapper.selectByLabelCode(labelCode);
    }

    public Integer selectCountByLabelCode(String labelCode) {
        return sysLabelMapper.selectCountByLabelCode(labelCode);
    }

    public int deleteLabelById(Long id) {
        return sysLabelMapper.deleteLabelById(id);
    }

    public List<SysOrgLabelDetail> selectDetailById(Long id) {
        return sysLabelMapper.selectDetailById(id);
    }

    public List<SysOrgLabelList> selectByPage(OrgLabelPageVO obj) {
        return sysLabelMapper.selectByPage(obj, (obj.getPageIndex() - 1) * obj.getPageSize(), obj.getPageSize());
    }

    public Integer count(OrgLabelPageVO obj) {
        return sysLabelMapper.count(obj);
    }

    public List<SysLabel> selectAllLabel(FeignBasePageReqVO param) {
        return sysLabelMapper.selectAllLabel((param.getPageIndex() - 1) * param.getPageSize(), param.getPageSize());
    }

    public Integer selectAllLabelCount() {
        return sysLabelMapper.selectAllLabelCount();
    }

    public List<OrgLabelUserInfoResVO> selectUserByOrgLabel(SelectEmployeeListQeqVO obj){
        return sysLabelMapper.selectUserByOrgLabel(obj,(obj.getPageIndex() - 1) * obj.getPageSize(), obj.getPageSize());
    }


    public Integer selectUserCountByOrgLabel(SelectEmployeeListQeqVO obj){
        return sysLabelMapper.selectUserCountByOrgLabel(obj);
    }

    public List<UserInfoResVO> getUsersByLable(SelectUserLabelReqVO vo) {
        return sysLabelMapper.getUsersByLable(vo);
    }
}
